<?php
/*-------------------------------------------------------------------------\
|
|  ========================================================
|  Fusion Registry GPL
|  Copyright (C) 2007 Fusion Scripts
|
|  This program is free software; you can redistribute it and/or
|  modify it under the terms of the GNU General Public License
|  as published by the Free Software Foundation; either version 2
|  of the License, or (at your option) any later version.
|
|  This program is distributed in the hope that it will be useful,
|  but WITHOUT ANY WARRANTY; without even the implied warranty of
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
|  GNU General Public License for more details.
|
|  You should have received a copy of the GNU General Public License
|  along with this program; if not, write to the Free Software
|  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
|  ========================================================
|
|  Email: info@fusionscripts.com
|  Web-Site: http://www.fusionscripts.com/
|
|  $Id: registry.php 4 2008-08-03 01:43:03Z registry.fusion $
|
\-------------------------------------------------------------------------*/

class ppi_registry
{
    var $ipsclass;
    var $portal_object = array();
    var $registry_config = array();
    var $lib;

    function init()
    {
        // Load Config variables
        $this->ipsclass->DB->query("SELECT config_name,config_value FROM ibf_registry_config");

        while ( $row = $this->ipsclass->DB->fetch_row() )
        {
            $this->registry_config[ $row['config_name'] ] = $row['config_value'];
        }

        // Load our skin
        $this->ipsclass->load_template('skin_registry_main');
        $this->ipsclass->load_template('skin_registry_gallery');

        // Load our language file
        $this->ipsclass->load_language('lang_registry');

        // Configuration file for the registry
        require( ROOT_PATH.'sources/components_public/fusion_config.php' );

		// Load our library functions
    	require REGISTRY_PATH.'lib/content.php';

        $this->lib['content'] = new registry_content();
        $this->lib['content']->ipsclass =& $this->ipsclass;
        $this->lib['content']->auto_run(&$this);
    }

    function registry_featured_item()
    {
        return $this->lib['content']->show_featureditem(1);
    }

    function registry_newest_items()
    {
        return $this->lib['content']->show_newestitems(1);
    }

    function registry_newest_mods()
    {
        return $this->lib['content']->show_newestmods(1);
    }

    function registry_most_modded()
    {
        return $this->lib['content']->show_mostmodded(1);
    }

    function registry_most_viewed()
    {
        return $this->lib['content']->show_mostviewed(1);
    }

    function registry_last_updated_items()
    {
        return $this->lib['content']->show_lastupdateditems(1);
    }

    function registry_last_updated_mods()
    {
        return $this->lib['content']->show_lastupdatedmods(1);
    }

    function registry_most_money_spent()
    {
        return $this->lib['content']->show_mostmoneyspent(1);
    }

    function registry_last_commented()
    {
        return $this->lib['content']->show_lastcommented(1);
    }

}
?>